[GOBBLIN-2168] Add TimeBasedSnapshotCleanupPolicyTest and Fix a bug with props.containsKey() instead of props.contains() in Trash class#4070
Open
linweihs wants to merge 9 commits intoapache:masterfrom
Open
Conversation
Will-Lo
requested changes
Oct 30, 2024
...t/src/main/java/org/apache/gobblin/data/management/trash/TimeBasedSnapshotCleanupPolicy.java
Outdated
Show resolved
Hide resolved
Will-Lo
requested changes
Oct 31, 2024
...t/src/main/java/org/apache/gobblin/data/management/trash/TimeBasedSnapshotCleanupPolicy.java
Outdated
Show resolved
Hide resolved
Contributor
Author
|
updated the implementation according to comment suggested. thanks for the review |
Will-Lo
requested changes
Nov 13, 2024
...c/test/java/org/apache/gobblin/data/management/trash/TimeBasedSnapshotCleanupPolicyTest.java
Outdated
Show resolved
Hide resolved
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #4070 +/- ##
============================================
- Coverage 45.12% 41.30% -3.82%
+ Complexity 3199 2233 -966
============================================
Files 705 485 -220
Lines 26949 20599 -6350
Branches 2680 2382 -298
============================================
- Hits 12160 8508 -3652
+ Misses 13781 11190 -2591
+ Partials 1008 901 -107 ☔ View full report in Codecov by Sentry. |
phet
requested changes
Nov 14, 2024
Contributor
phet
left a comment
There was a problem hiding this comment.
good impl fix here... but the test needs reworking
...c/test/java/org/apache/gobblin/data/management/trash/TimeBasedSnapshotCleanupPolicyTest.java
Outdated
Show resolved
Hide resolved
...c/test/java/org/apache/gobblin/data/management/trash/TimeBasedSnapshotCleanupPolicyTest.java
Outdated
Show resolved
Hide resolved
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Dear Gobblin maintainers,
Please accept this PR. I understand that it will not be reviewed until I have checked off all the steps below!
JIRA
Description
In existing trash cleaner, the comparison between snapshotTime and the current time is NOT done in the same time zone, this leads to longer hard deletion time due to time zone difference.

the fix ensure that the comparison between snapshotTime and the current time is done in the same time zone
gobblin.trash.snapshot.retention.comparison.useUTC.Updated 2024/11/20:
Tests
Implement a unit test class
[TimeBasedSnapshotCleanupPolicyTest.java](https://github.com/apache/gobblin/compare/master...linweihs:incubator-gobblin:welin/trash?expand=1#diff-59e30e386f99115a2511854af4f01812ea1cf832430c696bb48182af91713f77)ensuring the comparison are asserted expectedly.Commits